home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
Transport
/
tests
/
dclient.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
718b
|
39 lines
#include <iostream.h>
#include <stdio.h>
#include <osfcn.h>
#include <libc.h>
#include "RJS/Transport.h"
#include "RJS/Convert.h"
extern "C" {
void nerror(const char *s);
}
void test(char *name, char *obj)
{
char buffer[10];
DECnetAddress server_address(name,Convert::toInt(obj));
DECnetStream server;
cout << server_address.ss_message() << endl;
server.socket_for_client(server_address);
server.linger();
server.write("geek!",6);
server.read(buffer,6); // read from server
cout << "client: read ==> '" << buffer << "'" << endl;
}
int main(int argc, char *argv[])
{
if (argc!=3) {
cout<< "usage: " << argv[0] << "host object " << endl;
exit(1);
}
test(argv[1],argv[2]);
exit(0);
}